<template>
  <div>
    <div style="width: 100%;display: flex;margin: 10px 0">
      <el-menu :default-active="active" style="margin: 0 auto;background: none" mode="horizontal" router
      >
        <el-menu-item index="/sy">首页</el-menu-item>
        <el-menu-item index="/topBook">排行榜</el-menu-item>
        <el-menu-item index="/type">分类</el-menu-item>
        <el-menu-item index="/search">去搜索</el-menu-item>
        <!--<el-submenu index="/type">-->
        <!--  <template slot="title">类型</template>-->
        <!--  <span v-for="item in types" :key="item">-->
        <!--    <el-menu-item :index="'/type/'+item.id">-->
        <!--      {{ item.name }}-->
        <!--    </el-menu-item>-->
        <!--  </span>-->
        <!--</el-submenu>-->
      </el-menu>
    </div>
    <router-view></router-view>
  </div>
</template>
<script>
export default {
  name: "index",
  data() {
    return {
      active: '/sy'
    }
  },
  methods:{
  },
  mounted() {
    this.active=this.$route.path;
  }
}
</script>
<style scoped>

</style>